import Vue from "vue";
//1引入路由
import VueRouter from 'vue-router'
//2注册路由在vue构造函数中
Vue.use(VueRouter)

import home from "./views/home.vue";
import member from "./views/member.vue";
import shopcar from "./views/shopcar.vue";
import search from "./views/search.vue";
// 导入新闻
import newsList from "./components/news/newsList.vue";

// 导入详情
import newsInfo from "./components/news/newsInfo.vue";




import shopList from "./components/shop/shopList.vue";
import shopInfo from "./components/shop/shopInfo.vue";
const router = new VueRouter({
    routes: [
        { path: "/", redirect: "/home" },
        { path: "/home", component: home },
        { path: "/member", component: member },
        { path: "/shopcar", component: shopcar },
        { path: "/search", component: search },
        { path: "/home/newslist", component: newsList },
        { path: "/home/newsInfo/:id", component: newsInfo },
        { path: "/home/shopList", component: shopList },
        { path: "/home/shopInfo/:id", component: shopInfo },

    ],
    linkActiveClass: "mui-active"
})

export default router